home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / event.d / rc-default < prev    next >
Text File  |  2008-09-29  |  485b  |  24 lines

  1. # rc - runlevel compatibility
  2. #
  3. # This task guesses what the "default runlevel" should be and starts the
  4. # appropriate script.
  5.  
  6. start on stopped rcS
  7.  
  8. script
  9.     runlevel --reboot || true
  10.  
  11.     if grep -q -w -- "-s\|single\|S" /proc/cmdline; then
  12.         telinit S
  13.     elif [ -r /etc/inittab ]; then
  14.         RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)"
  15.         if [ -n "$RL" ]; then
  16.         telinit $RL
  17.         else
  18.         telinit 2
  19.         fi
  20.     else
  21.         telinit 2
  22.     fi
  23. end script
  24.